<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="Page.Page"   %>
<%@ page import="java.util.*"%>
<%@ page import="RoverCommodity.RoverCommodity"%>
<%@ page import="RoverCommodity.RoverCommodityShow"%>
<%@ page import="java.sql.*" %>

<html>
  <head>
    <title>流动商品显示最新4个商品</title>
  </head>
  <body>
    <form name="From1" method="POST" action="RoverCommodityShow.jsp">
	  	<table width="1000" border="20" height="600" align=center>
	  	<tr>
	  	<td>
	  	<table>
	  	<%
	  	         RoverCommodityShow db =new RoverCommodityShow();
	  	         ResultSet rs=db.CalFourRoverCommodity();
	  	         
	  	         while(rs.next())
	  	         {
	  	        		  RoverCommodity  RoverCommodity=new RoverCommodity();
		  	        	  RoverCommodity.setComID(rs.getString(1));
		  	        	  RoverCommodity.setRovID(rs.getString(2));
		  	        	  RoverCommodity.setComName(rs.getString(3));
		  	        	  RoverCommodity.setShaDate(rs.getString(4));
		  	        	  RoverCommodity.setSellerPh(rs.getString(5));
		  	        	  RoverCommodity.setSellerName(rs.getString(6));
		  	        	  RoverCommodity.setDesCribe(rs.getString(7));
		  	        	  RoverCommodity.setComImage(rs.getString(8));
		  	        	  RoverCommodity.setComPrice(rs.getFloat(9));
		  	        	  RoverCommodity.setComInf(rs.getString(10));
		  	        	  RoverCommodity.setRecency(rs.getInt(11));
		  	        	  
		  	        	 String saveurl=request.getRealPath("/")+RoverCommodity.getComImage();
		  	        	 out.print("<tr>");
		                 out.print("<td width=180 border=1>");
		            	 out.print("<table width=160 border=1>");
		            	 out.print("<tr align=left valign=top >");
		            	 out.print("<td width=160>");
		            	 out.print("<a href='RoverCommodityDetailed.jsp?RovComID="+RoverCommodity.getComID()+"&js="+"RoverCommodityShow.jsp"+"'>");
		            	 out.print("<img border=0 width=150 height=200 src=");
		            	 out.print("../"+RoverCommodity.getComImage());
		            	 out.print("></a>");
		                 out.print("</td>");
		                 out.print("<tr>");
		                
		                 out.print("<td align=center>");
		                
		                 out.print("<a href='RoverCommodityDetailed.jsp?RovComID="+RoverCommodity.getComID()+"&js="+"RoverCommodityShow.jsp"+"'>");
		                 out.print(RoverCommodity.getComName());
		                 out.print("</a>");
		                 out.print("</td>");
		                 out.print("</tr>");
		                 
		                 out.print("<tr>");
		                 out.print("<td align=center>");
		                 out.print("￥"+RoverCommodity.getComPrice());
		                 out.print("</td>");
		                 out.print("</tr>");
		                 out.print("<tr>");
		                 out.print("<td align=center>");
		                 out.print(RoverCommodity.getRecency()+"成新");
		                 out.print("</td>");
		                 out.print("</tr>");
		                 out.print("</table>");
		                 out.print("</td>");
	  	         }

   		 %>
   		 </table>
   		 </td>
   		 <tr>
   		 </table >
	</table>
  	</form>	
  </body>
</html>